<!doctype html>
<jsp:directive.page import="com.cn.ccp.bean.UserBean" />
<%@page import="com.cn.ccp.util.Contants"%>
<%@page contentType="text/html;charset=UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
<%
	String path = request.getContextPath();
	String basePath1 = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	UserBean users = (UserBean) session.getAttribute(Contants.USER_SESSION_BEAN);
%>
<html>
<f:view>
	<f:loadBundle var="messages" basename="messages"></f:loadBundle>
	<head>
<meta charset="utf-8">
<title><h:outputText value="#{messages['system_title']}" />
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<!-- styles -->
<link href="<%=request.getContextPath()%>/css/bootstrap.css"
	rel="stylesheet">
<link href="<%=request.getContextPath()%>/css/bootstrap-responsive.css"
	rel="stylesheet">
<link href="<%=request.getContextPath()%>/css/custom.css"
	rel="stylesheet">
<!--[if lt IE 9]>
      <script src="../js/html5.js"></script>
    <![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<%=request.getContextPath()%>/images/icon/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<%=request.getContextPath()%>/images/icon/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72"  href="<%=request.getContextPath()%>/images/icon/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<%=request.getContextPath()%>/images/icon/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="<%=request.getContextPath()%>/images/icon/favicon.png">
<link href="<%=request.getContextPath()%>/css/upload/default.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/upload/uploadify.css" rel="stylesheet" type="text/css" />
<script src="<%=request.getContextPath()%>/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/upload/swfobject.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/upload/jquery.uploadify.v2.0.1.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/themes/default/default.css" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/code/prettify.css" />
<script charset="utf-8" src="<%=request.getContextPath()%>/kindeditor.js"></script>
<script charset="utf-8" src="<%=request.getContextPath()%>/lang/zh_CN.js"></script>
<script charset="utf-8" src="<%=request.getContextPath()%>/plugins/code/prettify.js"></script>	
<script type="text/javascript" src="<%=request.getContextPath()%>/flexpaper/js/flexpaper_flash.js"></script>	
<style>
.firstColumn {
	width: 12%;
	text-align: center;
}

.secondColumn {
	width: 60%;
	text-align: right;
}

.thirdColumn {
	width: 50px;
	text-align: left;
}

.fourColumn {
	width: 30px;
	text-align: left;
}

.fiveColumn {
	width: 30px;
	text-align: left;
}
.form-white-bbs{
	position: relative; 
	border: 1px solid #ddd;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
}
</style>
<script type="text/javascript">
KindEditor.ready(function(K) {
	var editor1 = K.create('textarea[name="content1"]', {
		cssPath : '<%=basePath1%>/plugins/code/prettify.css',
		uploadJson : '<%=basePath1%>/jsp/upload_json.jsp',
		fileManagerJson : '<%=basePath1%>/jsp/file_manager_json.jsp',
		allowFileManager : true,
		afterCreate : function() {
			var self = this;
			K.ctrl(document, 13, function() {
				self.sync();
				//document.forms['example'].submit();
				document.getElementById("formid").submit();
			});
			K.ctrl(self.edit.doc, 13, function() {
				self.sync();
				document.getElementById("formid").submit();
				//document.forms['example'].submit();
			});
		},
		afterChange : function() {  
            K('.word_count1').html(this.count());  
            K('.word_count2').html(this.count('text')); 
            
        }  
	});
	 editor1.statusbar.remove(); 
	 prettyPrint();
	
});


function submit(){
	var c = document.getElementById("content").value();
	alert(c);
	document.getElementById("formid:hiddenContents").value() == c ;
	return true ;
}
</script>
	</head>
<base href="<%=basePath1%>" >
	<body class="bg-white" style="overflow-x:hidden;">
		<a id="viewDiv"></a>	
		<h:form id="formid" >
			<h:inputHidden value="#{courseForumReplyManagerAction.id}"></h:inputHidden>
			<h:inputHidden id="showEditBtn" value="#{courseForumReplyManagerAction.bean.showEdit}"></h:inputHidden>
			<div class="row page-head">
				<h3 class="page-title">
					<i class="n-icon-selection  n-icon-black"></i>
					<h:outputText value="#{messages['pages_bbs_title']}" />
					&nbsp;&gt;&nbsp;<b><h:outputText
							value="#{messages['pages_bbs_select_new_bbs']}" />(<h:outputText value="#{courseForumReplyManagerAction.bean.title}"></h:outputText>)
					</b>
				</h3>
			</div>
			<div style="margin-left: 20px; margin-right: 20px">
				<fieldset>
                    <div class="form-white-bbs">
						
                         <div style='margin-left:5px'>
                         	<h:graphicImage id="image" value="#{courseForumReplyManagerAction.userImage}"  style='float:left;height:77px;width:58px' ></h:graphicImage>
                         	<div style='margin-left:70px'>
                         		<h5>
                         			<h:outputText value="#{courseForumReplyManagerAction.bean.userName}："></h:outputText><small><h:outputText value="#{courseForumReplyManagerAction.bean.createTime}"></h:outputText></small>
                            		<p> 
		                            	<h:outputText  value="#{courseForumReplyManagerAction.bean.contents}" escape="false"></h:outputText>&nbsp;&nbsp;&nbsp;&nbsp;
		                            </p>
		                         </h5>    	
	                            	
                         	</div>
                         	
							<hr id="showHr1" style="margin-top:40px;display:none;border-bottom: 1px solid rgba(156, 164, 173, 0.63)">
							<hr id="showHr2" style="margin-top:10px;display:none;border-bottom: 1px solid rgba(156, 164, 173, 0.63)">
                        </div>
                        
                        
                        <a4j:outputPanel id="replyinfoText">
                        	<a4j:repeat var="forumBean" value="#{courseForumReplyManagerAction.list}">
                        		<f:verbatim>
                        			<div style='margin-left:5px'>
                        				<div >
                        		</f:verbatim>
                        					<h:graphicImage id="image" value="#{forumBean.userHeadImage}"  style='float:left;height:77px;width:58px' ></h:graphicImage>
                        		
                        		<f:verbatim>
                        				</div>
                        				<div style='margin-left:70px' ><div><div style='margin-left:10px' >
                        				<h5>
                        		</f:verbatim>
                        				<h:outputText  value="#{forumBean.userName}"/>
                        		<f:verbatim>
                        				: <small>
                        		</f:verbatim>		
                        				<h:outputText  value="#{forumBean.createTime}"/> <f:verbatim>&nbsp;&nbsp;</f:verbatim>	
                        				<a4j:commandLink action="#{courseForumReplyManagerAction.enableContent}"  
											reRender="replyinfoText" rendered="#{forumBean.status == -1}">
											<h:outputText value="#{messages['btn_enable']}" ></h:outputText>
											<f:param name="id" value="#{forumBean.id}" />
										</a4j:commandLink>
										<a4j:commandLink action="#{courseForumReplyManagerAction.disableContent}"  
											reRender="replyinfoText" rendered="#{forumBean.status == 1}">
											<h:outputText value="#{messages['btn_pingbi']}" ></h:outputText>
											<f:param name="id" value="#{forumBean.id}" />
										</a4j:commandLink>
										<h:outputText value="   "></h:outputText>
                        				<a4j:commandLink action="#{courseForumReplyManagerAction.deleteReply}" reRender="replyinfoText" styleClass="text-error">
	                        				<h:outputText value="#{messages['btn_delete']}" ></h:outputText>
											<f:param name="id" value="#{forumBean.id}" />
                        				</a4j:commandLink>
                        		<f:verbatim>
                        				</small><p>
                        		</f:verbatim>			
                        				<h:outputText  value="#{forumBean.contents}"/>
                        		<f:verbatim>
                        				</p>
                        				</h5>
                        				<br/></div></div></div>
                        				</div><hr  style='margin-top:10px;border-bottom: 1px solid rgba(156, 164, 173, 0.63)' />
                        		</f:verbatim>		
                        	</a4j:repeat>
                        </a4j:outputPanel>
                        
                        
                        <a4j:outputPanel ajaxRendered="true" id="panelgridid">
	                        <h:panelGrid columns="2" styleClass="pagination pagination-right" style="align:right" >
								<h:panelGrid columns="4" >
									<a4j:commandLink action="#{courseForumReplyManagerAction.firstPage}" styleClass="icon-fast-backward"  reRender="replyinfoText"></a4j:commandLink>
									<a4j:commandLink action="#{courseForumReplyManagerAction.provPage}" styleClass="icon-backward" reRender="replyinfoText"></a4j:commandLink>
									<a4j:commandLink action="#{courseForumReplyManagerAction.nextPage}" styleClass="icon-forward" reRender="replyinfoText"></a4j:commandLink>
									<a4j:commandLink action="#{courseForumReplyManagerAction.lastPage}" styleClass="icon-fast-forward" reRender="replyinfoText"></a4j:commandLink>
								</h:panelGrid>
								<h:panelGroup>
									<a4j:outputPanel ajaxRendered="true">
										<h:inputText value="#{courseForumReplyManagerAction.currentPage}" size="3" styleClass="input" style="width:20px"></h:inputText>
										<h:outputText value="/#{courseForumReplyManagerAction.countPage}#{messages['label_page']}"></h:outputText>
					
										<a4j:commandLink action="#{courseForumReplyManagerAction.goCurrentPage}"
											reRender="replyinfoText">
											<h:graphicImage value="/images/BtnPageGo.gif"></h:graphicImage>
										</a4j:commandLink>
										<h:outputText value="#{messages['label_all']}#{courseForumReplyManagerAction.itemCount}#{messages['label_count']}"></h:outputText>
									</a4j:outputPanel>
								</h:panelGroup>
							</h:panelGrid>
                        </a4j:outputPanel>
						<h:commandButton value="返回列表" action="main" styleClass="btn pull-right" immediate="true" style="float:left;margin-left:20px;margin-top: -20px;"/>
                            <hr />
                        </div>
                        
                    </div>
                  </fieldset>
			</div>
		</h:form>
		<script src="<%=request.getContextPath()%>/js/jquery-1.8.3.min.js"></script>
		<script src="<%=request.getContextPath()%>/js/bootstrap.js"></script>
		<script type="text/javascript">
			var value = document.getElementById("formid:showEditBtn").value;
			if(value === 'true'){
				document.getElementById("showHr2").style.display = 'block';
			}else{
				document.getElementById("showHr1").style.display = 'block';
			}
			
			$(document).ready(function() {
				//document.getElementById('viewDiv').scrollIntoView();
			});
		</script>
	</body>
</f:view>
</html>
